StringBuffer sb = new StringBuffer();
sb.append("hahaha");//添加字符串
System.out.println(sb);//haha
sb.insert(2,"it");//在指定下标位置插入
System.out.println(sb);//haitha
sb.delete(1,4);//删除，包头不包尾(不包含4)
System.out.println(sb);//hha
sb.replace(1,4,"cast");//替换指定范围内的内容
System.out.println(sb);//hcast
String str = sb.toString();//返回String类
System.out.println(str);//hcast
